package ar.com.agea.exception;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public abstract class AbstractException extends RuntimeException {

	private List<String> messages = new ArrayList<String>();

	public AbstractException() {
		super();
	}

	public AbstractException(Collection messages) {
		this.messages.addAll(messages);
	}

	public AbstractException(String message, Throwable cause) {
		super(message, cause);
		messages.add(message);
	}

	public AbstractException(String message) {
		super(message);
		messages.add(message);
	}

	public AbstractException(Throwable cause) {
		super(cause);
	}

	public AbstractException addMessage(String message) {
		messages.add(message);
		return this;
	}

	/**
	 * @return the messages
	 */
	public List<String> getMessages() {
		return messages;
	}

}
